package com.wj.mapper;

import com.wj.pro.Users;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UsersMapper {

    @Select("select * from users")
    public List<Users> findAll();

    @Delete("delete from users where id=#{id}")
    int deletes(int id);

    @Insert("insert into users(name,age) values(#{name},#{age})")
    int add(Users users);

    @Update("update users set name=#{name},age=#{age} where id=#{id}")
    int edit(Users users);

    @Select("select * from users where id=#{id}")
    Users getById(int id);
}
